package cn.qxnekoo.chain.service.impl;

import cn.qxnekoo.chain.service.*;

/**
 * @author tdf
 * @date 2020-05-25 15:41
 **/
public class Chain extends AbstractHandler {

	public Chain(int level) {
		super(level);
	}

	@Override
	protected boolean handle(AbstractRequest request) {
		if (request.getRequestLevel() == this.getLevel()) {
			try {
				ProxInteface object = (ProxInteface)request.getObject();
				object.excute(getLevel());
			}catch (Exception e) {
				e.printStackTrace();
			}
			System.out.println("chain" + getLevel() + " 处理了");
			return true;
		}else {
			System.out.println("chain" + getLevel() + "没处理");
			return false;
		}

	}
}
